//
//@File    :	5.9_forstr2.cpp
//@Time    :	2021/08/04 21:59:33
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	reversing an array
//

#include <string>
#include <iostream>

int main()
{
    using namespace std;
    cout<<"Enter a word: ";
    string word;
    cin>>word;

    char temp;
    int i,j;
    for (j=0, i = word.size()-1; j<i; --i,++j)
    {
        temp = word[i];
        word[i] = word[j];
        word[j] = temp;
    }
    cout<<word<<"\nDone\n";
    system("pause");
    return 0;
}